Package-level declarations
Types
UI-to-model message conversion. Groups convertToModelMessages and its helpers so none remain loose top-level functions.
Streaming-vs-final state for UIMessagePart.Text and UIMessagePart.Reasoning (per historical parity gap #30, mirrors v6's TextUIPart.state: 'streaming' | 'done'). Renderers use this to drive a typing cursor / fade animation while the model is still producing the part, and to commit a final layout pass on Done.
Tool call lifecycle in the UI. v6 names — input-streaming / input-available / output-available, NOT v5's partial-call / call / result.
Registry of per-tool renderers. The SDK is UI-framework-agnostic — the registry holds renderer functions that take UIToolInvocation. An application can supply Compose composables, SwiftUI bridge closures, server-rendered nodes, or any other renderer value.
UI-shape message — what the chat surface renders. Carries an ordered list of UIMessageParts (Vercel AI SDK v6 message-parts model). The conversion from ai.torad.aisdk.StreamEvent flow into a growing list of these messages happens in streamToUiMessages.
Functions
Faux-constructor builder for ToolPartHandlerRegistry.
Bridge an agent StreamEvent flow to the v6 UI-message-stream wire protocol: each emission is a UIMessageChunk JSON object (e.g. { "type": "text-delta", "id": "...", "delta": "..." }) ready to be framed as an SSE data: line and consumed by a JS useChat client. Events with no wire counterpart (response-metadata, tool-input-end, raw) are dropped.